package com.jerei.store;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.unit.DataSize;

import javax.servlet.MultipartConfigElement;

@Configuration
@MapperScan("com.jerei.store.mapper")
@SpringBootApplication
public class StoreApplication {

    public static void main(String[] args) {
        SpringApplication.run(StoreApplication.class, args);
    }
    @Bean
    public MultipartConfigElement getMultipartConfigElement(){
        MultipartConfigFactory multipart= new MultipartConfigFactory();
        multipart.setMaxFileSize(DataSize.ofMegabytes(100));
        multipart.setMaxRequestSize(DataSize.ofMegabytes(100));
        return multipart.createMultipartConfig();
    }

}
